package com.tensquare.notice.config;

import com.tensquare.notice.netty.NettyService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NettyConfig {

  @Bean
  public NettyService createNettyServer() {
    NettyService nettyService = new NettyService();

    // 启动Netty服务，使用新的线程
    new Thread() {
      @Override
      public void run() {
        nettyService.start(1234);
      }
    }.start();

    return nettyService;
  }
}
